// 区分开发环境和生产环境

// vite默认提供的环境变量
// console.log(import.meta.env.DEV) // 是否开发环境
// console.log(import.meta.env.PROD) // 是否生产环境
// console.log(import.meta.env.SSR) // 是否是服务器端渲染(server side render)

export let BASE_URL = ''
if (import.meta.env.DEV) {
  BASE_URL = '/api'
} else if (import.meta.env.PROD) {
  BASE_URL = '/api'
}

export const TIME_OUT = 10000

export interface OssType {
  url?: string
  data?: any
  otherUrl?: boolean
  xAmzAcl?: boolean
  fileType?: string
}

export interface ContentType extends OssType {
  isJson?: Boolean
  isFormData?: Boolean
  isFormUrlEncode?: Boolean
  isJsonUrlEncode?: Boolean
}

export enum ContentTypeEnum {
  JSON = 'application/json;charset=UTF-8', // json
  FORM_DATA = 'multipart/form-data;charset=UTF-8', // form-data  upload
  FORM_URLENCODED = 'application/x-www-form-urlencoded;charset=UTF-8', // form-data qs
  JSON_URLENCODED = 'application/json;charset=UTF-8' // json qs
}
